package com.google.shop.product.controller.product;

import com.google.shop.product.common.utils.R;
import com.google.shop.product.service.product.ItemService;
import com.google.shop.product.service.product.ProductSpuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping({"/product"})
@RestController
/* loaded from: app.jar:BOOT-INF/classes/com/google/shop/product/controller/product/ProductSpuController.class */
public class ProductSpuController {
    @Autowired
    private ProductSpuService spuService;
    @Autowired
    private ItemService itemService;

    @GetMapping({"/home"})
    public R home() {
        return R.ok(this.spuService.findHomeVO());
    }

    @GetMapping({"/findProductListByCategoryId/{categoryId}"})
    public R findProductListByCategoryId(@PathVariable("categoryId") Integer categoryId) {
        return R.ok(this.spuService.findProductListByCategoryId(categoryId));
    }

    @GetMapping({"/findItemBySpuId/{spuId}"})
    public R findItemBySpuId(@PathVariable("spuId") Integer spuId) {
        return R.ok(this.itemService.findItemVO(spuId));
    }
}
